package com.tuanzi.loan.vo.request.settlement;

import lombok.Data;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;

/**
 * @author caiwanlin
 * @create 2018-01-16 16:45
 */
@Data
public class SettlementPriceChangeRecordRequest implements Serializable {
    private static final long serialVersionUID = 2586062213424966203L;

    private Date startTime;
    private Date endTime;
    private String companyName;
    private String productName;


    public void setEndTime(Date endTime) {
        if (endTime != null) {
            Calendar instance = Calendar.getInstance();
            instance.setTime(endTime);
            instance.add(Calendar.HOUR_OF_DAY, 23);
            instance.add(Calendar.MINUTE, 59);
            instance.add(Calendar.SECOND, 59);
            this.endTime = instance.getTime();
        }
        else {
            this.endTime = endTime;
        }
    }
}
